//
//  MHCirleMoreTableViewController.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/10/23.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHCirleMoreTableViewController.h"
#import "MHSearchResultTableViewCell.h"
#import "JKRSearchController.h"
#import "MHSearchCircleModel.h"
#import "MHSearchCircelCell.h"
#import "MHDiscoverHomeModel.h"
#import "MHCircleMoreViewModel.h"

@interface MHCirleMoreTableViewController ()
@property(nonatomic, strong) MHCircleMoreViewModel *viewModel;
@end

@implementation MHCirleMoreTableViewController
@dynamic viewModel;
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.tableView mh_registerNibCell:MHSearchCircelCell.class];
    self.tableView.estimatedRowHeight= 87;
    self.tableView.rowHeight=UITableViewAutomaticDimension;
    
    self.tableView.backgroundColor  = [UIColor whiteColor];
    //    [self.viewModel.requstAskCountCommand execute:nil];
}

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.tableView.emptyDataSetDelegate = nil;
    self.tableView.emptyDataSetSource = nil;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//-(UIEdgeInsets)contentInset
//{
//    return UIEdgeInsetsMake(0, 0, 0, 0);
//}

- (UITableViewCell *)tableView:(UITableView *)tableView dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath{
    return [tableView dequeueReusableCellWithIdentifier:@"MHSearchCircelCell"];
}


- (void)configureCell:(MHSearchCircelCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object{
    [cell bindViewModel:object];
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [super tableView:tableView didSelectRowAtIndexPath:indexPath];
    MHSearchCircleModel *search = self.viewModel.datas[indexPath.row];
    MHDiscoverHomeModel *model = [MHDiscoverHomeModel new];
    model.circleId = search.circleId;
    model.isInCircle = search.isInCircle;
    model.circleName = search.title;
    model.payType = search.payType;
    model.circleCode = search.circleCode;
    [AXAppDelegate sharedDelegate].currentDiscoverModel = model;

}




@end
